<?php
/**
 * Fake4
 * @copyright   Copyright(c) 2024-2034
 * @author      tianjie <527707665@qq.com>
 * @link        http://www.tinphp.com/
 */
 
namespace app\index\controller;

use tian\Controller;

class Index extends Controller
{
    /**
     * 不需要登录的方法
     */
    protected $noNeedLogin = ['index'];

    public function index()
    {
        echo "<p style='font-size:30px;'>Hello,I'm Index->index<br>Welcome to use Fake v".version()."</p>";
    }

    public function hello($name = 'World')
    {
        return "Hello, $name!";
    }

    public function hello2($name = 'World')
    {
        return response($name);
    }

    public function hello3()
    {
        $data = [
            'name' => 'fake4',
            'version' => version()
        ];
        return json($data);
    }

}
